package com.wgy.day10.面向对象;

/**
 * Created by pc on 2020/11/6 23:25
 * Description: LearningJava
 */
public class Demo07Method_封装性 {
    public static void main(String[] args) {
        int[] array = {10, 20, 30, 40, 50, 60, 70, 100};
        int max = getMax(array);
        System.out.println("最大值:" + max);


    }


    public static int getMax(int[] array) {
        int max = array[0];
        for (int i = 0; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
            ;
        }
        return max;
    }

}
